import service from '@/utils/request'
// @Tags FileUploadAndDownload
// @Summary 分页文件列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取文件户列表"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /file/getFileList [get]
export const getFileList = (data) => {
	return service({
		url: "/file/getFileList",
		method: "get",
		params: data
	})
}

// @Tags FileUploadAndDownload
// @Summary 删除文件
// @Security ApiKeyAuth
// @Produce  application/json
// @Param data body dbModel.FileUploadAndDownload true "传入文件里面id即可"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /fileUploadAndDownload/deleteFile [post]
export const deleteFile = (data) => {
    return service({
        url: "/file/deleteFile",
        method: "delete",
        data
    })
}

export const uploadImage = (data, header) => {
	return service.post("/file/uploadImage", data, header)
}

export const uploadExcel = (data) => {
	return service({
	    url: "/file/uploadExcel",
	    method: "post",
	    data
	})
}

export const downloadFile = (data) => {
	return service({
		url: "/file/downloadFile",
		method: "post",
		data
	})
}

export const updateFileName = (data) => {
	return service({
		url: "/file/updateFileName",
		method: "put",
		data
	})
}